package com.ruoyi.edu.api.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 课程管理对象 edu_course
 *
 * @author isahino
 * @date 2023-09-14
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("edu_course")
public class EduCourse extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 课程ID
     */
    @TableId(type = IdType.ASSIGN_ID)
    private String id;

    /**
     * 讲师
     */
    @Excel(name = "讲师")
    private String teacherId;

    /**
     * 类别
     */
    @Excel(name = "类别")
    private String subjectId;

    /**
     * 大类
     */
    private String subjectParentId;

    /**
     * 标题
     */
    @Excel(name = "标题")
    private String title;

    /**
     * 销售价格
     */
    @Excel(name = "销售价格")
    private BigDecimal price;

    /**
     * 总课时
     */
    @Excel(name = "总课时")
    private Integer lessonNum;

    /**
     * 封面图
     */
    @Excel(name = "封面图")
    private String cover;

    /**
     * 销量
     */
    @Excel(name = "销量")
    private Integer buyCount;

    /**
     * 浏览数
     */
    @Excel(name = "浏览数")
    private Integer viewCount;

    /**
     * 乐观锁
     */
    @Version
    private String version;

    /**
     * 状态
     */
    @Excel(name = "状态")
    private String status;

    /**
     * 逻辑删除 1（true）已删除， 0（false）未删除
     */
    @TableLogic
    private Integer isDeleted;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @TableField(fill = FieldFill.INSERT)
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date gmtCreate;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date gmtModified;

    /**
     * 课程详情信息
     */
    @TableField(exist = false)
    private String description;
}
